home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
UTILITIE
/
CPU_MEMO
/
0577.ZIP
/
MSUN.DOC
< prev
next >
Wrap
Text File
|
1987-02-27
|
6KB
|
175 lines
MSUN.DOC by Doug Hogarth - Preliminary version - 02/26/87
Note: Since this is a preliminary version, please limit distribution.
Comments for the release version are encouraged.
This document attempts to explain many undocumented (or little documented)
features of MS-DOS. Most features are not guaranteed to work reliably or be
present in future versions of MS-DOS, and should be avoided whenever possible.
MS-DOS Interrupts
INT 28H
This interrupt is usually called during the keyboard routine as a hook for
multi-tasking.
INT 29H - Video
This interrupt performs the INT 10H write TTY function in b/w, saving BP.
INT 2AH - Network (MS-DOS 3.0)
These are the NET functions. AH=0 checks if installed, AH=3 checks if absolute
disk access is allowed, AH=4 is EXEC NETBIOS, and AH=5 gets information. There
are other functions including 80H, 81H, 82H, and 84H which are called from MS-
DOS.
INT 2EH
This interrupt is a quickie EXEC?
(INT 2FH - Multiplex)
This funtion is partially documented. It is extended in network environments.
Function B7H is the APPEND check, and Function B8H is the check for network
software installed and get/set current post address.
Other Interrupts
INT 33H - Mouse
INT 3FH - Overlay
INT 67H - EMM
MS-DOS Functions
Function 18H - Return Login Vector
This function in CP/M returned values in A and HL. Set bits indicated that a
drive was on-line. It always returns zero.
Function 1DH - Get Read/Only Vector
This function in CP/M returned a value in HL. Set bits indicated a read-only
condition. It always returns zero.
Function 1EH - Set File Attributes
This function in CP/M was passed an FCB address, and the DEC for that file was
returned in A. It does nothing.
Function 1FH - Get Disk Parameters
This function returns the address of disk parameters. It returns DS:BX
pointing to a table of parameters for the current drive.
Function 20H - Set/Get User Code
This function in CP/M would set the USER code (0-31), or get the current code
in A if FFH. It always returns zero.
(Function 30H - Get DOS Version Number) (MS-DOS 2.0)
This function is documented, but two return values are little documented. BH
returns the OEM number, and BL:CX returns a 24-bit user number (often zero).
Some OEM values are 0:IBM (PC-DOS), 28H:TI, FFH:Others (MS-DOS).
Function 32H
This function is passed a drive code (0=default, 1=A, etc.) in DL, and returns
AL=FFH if the drive is invalid. Otherwise, DS:BX points to a table:
Offset 0 is a BYTE containing the drive (0=A, etc.)
Offset 1 is a BYTE containing the unit within the drive (0, etc.)
Offset 2 is a WORD count of the bytes per sector
Offset 4 is a BYTE count of the sectors per cluster-1
Offset 5 is a BYTE containing the sectors per cluster as a power of 2
Offset 6 is a WORD count of the reserved sectors
Offset 8 is a BYTE count of the FATs
Offset 9 is a WORD count of the root directory entries
Offset 0BH is a WORD containing the first data sector
Offset 0DH is a WORD count of the number of clusters + 1
Offset 0FH is a BYTE count of the sectors/FAT
Offset 10H is a WORD containing the sector of the directory
Offset 12H is a DWORD pointer to the device header
Offset 16H is a BYTE containing the media descriptor
Offset 17H is a BYTE containing 0 if the disk has been accessed
Offset 18H is a DWORD pointer to the next block (or FFFFFFFF)
Function 34H - Get DOS Critical Flags (INDOS)
(Note: This function is documented in technical information from Zenith)
This function returns with ES:BX pointing to a byte count useful for TSR
programs. If this byte is non-zero, DOS functions greater than 0CH should not
be used (a few like 30H, 59H, 33H, 50H, 51H, and 62H are okay). The previous
byte is a critical error byte - if it is set, TSR programs should not mess with
anything.
Function 37H - SWITCHAR & AVAILDEV
DOS 2.0 and 2.10 allowed these two statements in CONFIG.SYS files. They were
implemented to make DOS more like Xenix in path names and switch characters.
AL=0 gets SWITCHAR, AL=1 sets SWITCHAR, AL=2 gets AVAILDEV, AL=3 sets AVAILDEV.
SWITCHAR and AVAILDEV are passed in DL. If AVAILDEV=0, device names must be
preceded by \DEV\. Several programs from MS use this function.
Function 50H
This function sets the current PSP. BX is the segment address.
Function 51H - Get PSP Address
This function gets the current PSP. See function 62H in MS-DOS 3.0 or later.
TopView uses this.
Function 52H - IVARS
This function returns a pointer to a DWORD containing the DS:BX value for
function 32H, DL=1. See function 32H for details.
Function 53H
This function is passed DS:SI pointing to a BIOS parameter block table, and
ES:BP pointing to a table. It returns with the destination table translated
from the source.
Function 55H
This function has something to do with the DTA?
Function 58H - Get/Set Allocation Strategy (MS-DOS 3.0)
(Note: This function is documented by MS in Advanced MS-DOS)
AL=0 means get the current strategy, AL=1 means set the strategy. The strategy
code in BX is 0:First fit, 1:Best fit, and 2:Last fit.
Function 5DH
This function has something to do with restoring the extended error
information?
Function 60H - Get Directory
This function copies the default drive and current directory (ASCIIZ) to the
address specified by ES:DI. AL contains one of the characters from the
routine.
Function 61H - Reserved
Function 63H - Get/Set Lead Byte Table (MS-DOS 2.25 ONLY)
(Note: This function is documented by MS in Advanced MS-DOS)
Function 64H - (MS-DOS 3.20)
This function passes a counter in AL.
Function 89H - Sleep
(This function was mentioned in the MSC 4.0 startup code)
Function F8H - Set OEM Interrupt Handler
DS:DX points to the handler which ends with IRET. Use FFFF:FFFF to reset.
Don't remember where this info came from, and it is not currently present.
Functions F9-FFH - OEM Interrupts
These functions return with carry set and AX=1 (?) if not initialized.